<div class="container-fluid">
    <app-page-title name="Checklists" [breadcrumbItems]="breadCrumbItems"></app-page-title>

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-name mb-4">Create Checklist Item</h4>
                    <form class="needs-validation" (ngSubmit)="validSubmit()" [formGroup]="checklistForm">
                        <div class="form-group">
                            <label for="name">name</label>
                            <input type="text" class="form-control" id="name" formControlName="name"
                                placeholder="Checklist name" onfocus="this.placeholder =''"
                                onblur="this.placeholder = 'Checklist name'"
                                [ngClass]="{'is-invalid': submit && form.name.errors}">
                            <div *ngIf="submit && form.name.errors" class="invalid-feedback">
                                <span *ngIf="form.name.errors.required">Required!</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="description">Description</label>
                            <textarea type="text" class="form-control" id="description" formControlName="description"
                                placeholder="Checklist Description" onfocus="this.placeholder = ''"
                                onblur="this.placeholder = 'Checklist Description'"
                                [ngClass]="{'is-invalid': submit && form.description.errors}" rows="10"></textarea>
                            <div *ngIf="submit && form.description.errors" class="invalid-feedback">
                                <span *ngIf="form.description.errors.required">Required!</span>
                            </div>
                        </div>
                        <div class="form-group mb-4">
                            <label for="status-input">Status</label>
                            <select type="number" formControlName="visibility" class="custom-select" id="status-input">
                                <option value=True>Activate</option>
                                <option value=False>Deactivate</option>
                            </select>
                        </div>
                        <div class="text-right">
                            <button (click)="createChecklistType()" class="btn btn-success mr-2"
                                type="button">Create</button>
                            <button [routerLink]="['/checklists/view']" class="btn btn-danger"
                                type="button">Cancel</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>